/** 面板展示页面 
 * 
 */

import React from 'react'
import classNames from 'classnames'

import styles from './index.scss'

export default class Panel extends React.Component {
  render() {
    const { className, title, children, extras } = this.props
    return (
      <div
        className={styles.wrapper}
        data-test={`panel-${
          title
            ? title
                .toLowerCase()
                .split(' ')
                .join('-')
            : 'default'
        }`}
      >
        {title && <div className={styles.title}>{title}</div>}
        <div className={classNames(styles.panel, className)}>{children}</div>
        {extras}
      </div>
    )
  }
}
 